﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="urn:effun-net-dycox-report"
    elementFormDefault="qualified"
    xmlns="urn:effun-net-dycox-report"
    xmlns:mstns="urn:effun-net-dycox-report"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:complexType name="report">
    <xs:sequence>
      <xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
      <xs:element name="variables" minOccurs="0" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="var" maxOccurs="unbounded" minOccurs="0">
              <xs:complexType>
                <xs:attribute name="name" type="xs:Name" use="required"></xs:attribute>
                <xs:attribute name="value" type="xs:string" use="required"></xs:attribute>
                <xs:attribute name="type" type="xs:string"></xs:attribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="pageSettings" >
        <xs:complexType>
          <xs:all>
            <xs:element name="paper">
              <xs:complexType>
                <xs:attribute name="name" use="required">
                  <xs:simpleType>
                    <xs:union memberTypes="paperKinds xs:Name"></xs:union>
                  </xs:simpleType>
                </xs:attribute>
                <xs:attribute name="width" type="xs:float" use="required"></xs:attribute>
                <xs:attribute name="height" type="xs:float" use="required"></xs:attribute>
                <xs:attribute name="landscape" type="xs:boolean"></xs:attribute>
                <xs:attribute name="margins" type="paddings"></xs:attribute>
              </xs:complexType>
            </xs:element>
          </xs:all>
          <xs:attribute name="unit" default="Millimeter">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="Millimeter"></xs:enumeration>
                <xs:enumeration value="Centimeter"></xs:enumeration>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="columns" default="1">
            <xs:simpleType>
              <xs:restriction base="xs:integer">
                <xs:minInclusive value="1"></xs:minInclusive>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="rows" default="0" type="xs:nonNegativeInteger"></xs:attribute>
          <xs:attribute name="pageBreak">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="Auto"></xs:enumeration>
                <xs:enumeration value="Report"></xs:enumeration>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="overflow-v" type="overflow"></xs:attribute>
          <xs:attribute name="overflow-h" type="overflow"></xs:attribute>
          <xs:attribute name="space-v" type="xs:float" default="1"></xs:attribute>
          <xs:attribute name="space-h" type="xs:float" default="1"></xs:attribute>
        </xs:complexType>
      </xs:element>
      <xs:element name="body" type="bodyElement" maxOccurs="1"></xs:element>
    </xs:sequence>
    <xs:attribute name="name" use="required" type="xs:Name"></xs:attribute>
  </xs:complexType>

  <xs:simpleType name="overflow">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NewPage"></xs:enumeration>
      <xs:enumeration value="Clip"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="paperKinds">
    <xs:restriction base="xs:string">
      <xs:enumeration value="A4"></xs:enumeration>
      <xs:enumeration value="A5"></xs:enumeration>
      <xs:enumeration value="A3"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  
  <xs:complexType name="margins">
    <xs:attribute name="left" type="xs:float"></xs:attribute>
    <xs:attribute name="top" type="xs:float"></xs:attribute>
    <xs:attribute name="right" type="xs:float"></xs:attribute>
    <xs:attribute name="bottom" type="xs:float"></xs:attribute>
  </xs:complexType>

  <xs:simpleType name="paddings">
    <xs:restriction base="xs:string">
      <xs:pattern value="[+-]?\d+(\.\d+)?(,[+-]?\d+(\.\d+)?){0,3}"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="point">
    <xs:restriction base="xs:string">
      <xs:pattern value="[+-]?\d+(\.\d+)?,[+-]?\d+(\.\d+)?"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="size">
    <xs:restriction base="xs:string">
      <xs:pattern value="\d+(\.\d+)?,\d+(\.\d+)?"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <!--<xs:simpleType name="rectangle">
    <xs:restriction base="xs:string">
      <xs:pattern value="\d+(\.\d+)?\s+\d+(\.\d+)?\s+(\d+(\.\d+)?|auto|\*)\s+(\d+(\.\d+)?|auto|\*)"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>-->

  <xs:complexType name="containerElement">
    <xs:complexContent>
      <xs:extension base="blockElement">
        <xs:group ref="elementCollection" minOccurs="0" maxOccurs="unbounded"></xs:group>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="length">
    <xs:restriction base="xs:float">
      <xs:minInclusive value="0"></xs:minInclusive>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="bodyElement">
    <xs:complexContent>
      <xs:extension base="containerElement">
        <xs:group ref="elementCollection" minOccurs="0" maxOccurs="unbounded"></xs:group>
        <xs:attribute name="location" type="point" use="optional"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:group name="elementCollection">
    <xs:choice>
      <xs:element name="textBlock" type="textBlock"></xs:element>
      <xs:element name="line" type="line"></xs:element>
      <xs:element name="container" type="containerElement"></xs:element>
      <xs:element name="table" type="table"></xs:element>
      <xs:element name="dataSheet" type="dataSheet"></xs:element>
    </xs:choice>
  </xs:group>

  <xs:complexType name="textBlock">
    <xs:complexContent>
      <xs:extension base="blockElement">
        <xs:attribute name="text" use="required" type="xs:string"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="line">
    <xs:complexContent>
      <xs:extension base="reportElement">
        <xs:attribute name="x1" type="xs:float"></xs:attribute>
        <xs:attribute name="y1" type="xs:float"></xs:attribute>
        <xs:attribute name="x2" type="xs:float"></xs:attribute>
        <xs:attribute name="y2" type="xs:float"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  
  <xs:complexType name="polyline">
    <xs:complexContent>
      <xs:extension base="reportElement">
        <xs:sequence>
          <xs:element name="points">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="point" maxOccurs="unbounded" minOccurs="2">
                  <xs:complexType>
                    <xs:attribute name="X" type="xs:float" use="required"></xs:attribute>
                    <xs:attribute name="Y" type="xs:float" use="required"></xs:attribute>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="table">
    <xs:complexContent>
      <xs:extension base="blockElement">
        <xs:sequence>
          <xs:element name="columns">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="column" maxOccurs="unbounded" type="tableColumn">
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="rows">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="row" maxOccurs="unbounded">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="cell" minOccurs="0" maxOccurs="unbounded" type="tableCell">
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="height" type="unit"></xs:attribute>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="cellPadding" type="xs:float"></xs:attribute>
        <xs:attribute name="standardCellSize" type="size"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="tableColumn">
    <xs:attribute name="width" type="unit"></xs:attribute>
  </xs:complexType>

  <xs:complexType name="tableCell">
    <xs:all>
      <xs:element name="style" type="elementStyle" minOccurs="0"></xs:element>
    </xs:all>
    <xs:attribute name="text" type="xs:string"></xs:attribute>
    <xs:attribute name="colSpan" type="span"></xs:attribute>
    <xs:attribute name="rowSpan" type="span"></xs:attribute>
  </xs:complexType>

  <xs:complexType name="dataSheetCell">
    <xs:all>
      <xs:element name="style" type="elementStyle" minOccurs="0"></xs:element>
    </xs:all>
    <xs:attribute name="text" type="xs:string"></xs:attribute>
  </xs:complexType>

  <xs:complexType name="dataSheetBodyCell">
    <xs:complexContent>
      <xs:extension base="dataSheetCell">
        <xs:attribute name="dataMember" type="xs:string"></xs:attribute>
        <xs:attribute name="format" type="xs:string"></xs:attribute>
        <xs:attribute name="nullText" type="xs:string"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  
  <xs:complexType name="dataSheet">
    <xs:complexContent>
      <xs:extension base="blockElement">
        <xs:sequence>
          <xs:element name="columns">
            <xs:complexType>
              <xs:sequence maxOccurs="unbounded">
                <xs:element name="column">
                  <xs:complexType>
                    <xs:complexContent>
                      <xs:extension base="tableColumn">
                        <xs:all>
                          <xs:element name="header" minOccurs="0">
                            <xs:complexType>
                              <xs:complexContent>
                                <xs:extension base="dataSheetCell">
                                  <xs:attribute name="group" type="xs:string"></xs:attribute>
                                </xs:extension>
                              </xs:complexContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="body" type="dataSheetBodyCell"></xs:element>
                          <xs:element name="footer" minOccurs="0">
                            <xs:complexType>
                              <xs:complexContent>
                                <xs:extension base="dataSheetBodyCell">
                                  <xs:attribute name="aggregation">
                                    <xs:simpleType>
                                      <xs:restriction base="xs:string">
                                        <xs:enumeration value="None"></xs:enumeration>
                                        <xs:enumeration value="Sum"></xs:enumeration>
                                        <xs:enumeration value="Max"></xs:enumeration>
                                        <xs:enumeration value="Min"></xs:enumeration>
                                        <xs:enumeration value="AverageAll"></xs:enumeration>
                                        <xs:enumeration value="AverageValues"></xs:enumeration>
                                        <xs:enumeration value="CountAll"></xs:enumeration>
                                        <xs:enumeration value="CountValues"></xs:enumeration>
                                      </xs:restriction>
                                    </xs:simpleType>
                                  </xs:attribute>
                                </xs:extension>
                              </xs:complexContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:all>
                      </xs:extension>
                    </xs:complexContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="dataMember" type="xs:string" ></xs:attribute>
        <xs:attribute name="cellPadding" type="xs:float"></xs:attribute>
        <xs:attribute name="standardCellSize" type="size"></xs:attribute>
        <xs:attribute name="rowCount" type="xs:int"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="blockElement" abstract="true">
    <xs:complexContent>
      <xs:extension base="mstns:reportElement">
        <xs:attribute name="location" type="point" use="required"></xs:attribute>
        <xs:attribute name="size" type="size"></xs:attribute>
        <xs:attribute name="paddings" type="paddings"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="reportElement" abstract="true">
    <xs:sequence>
      <xs:element name="style" type="elementStyle" minOccurs="0" maxOccurs="1"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="elementStyle">
    <xs:sequence>
      <xs:element name="font" type="fontStyle" maxOccurs="1" minOccurs="0"></xs:element>
      <xs:element name="background" type="backgroundStyle" maxOccurs="1" minOccurs="0"></xs:element>
      <xs:element name="border" type="borderStyle" maxOccurs="1" minOccurs="0"></xs:element>
    </xs:sequence>
    <xs:attribute name="foreColor" type="color"></xs:attribute>
    <xs:attribute name="hAlign" type="hAlign"></xs:attribute>
    <xs:attribute name="vAlign" type="vAlign"></xs:attribute>
  </xs:complexType>

  <xs:simpleType name="span">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="1"></xs:minInclusive>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="unit">
    <xs:restriction base="xs:string">
      <xs:pattern value="\d+(\.\d+)?\%?"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="hAlign">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Left"></xs:enumeration>
      <xs:enumeration value="Center"></xs:enumeration>
      <xs:enumeration value="Right"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="vAlign">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Top"></xs:enumeration>
      <xs:enumeration value="Middle"></xs:enumeration>
      <xs:enumeration value="Bottom"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="fontStyle">
    <xs:attribute name="family"  type="xs:string" use="required"></xs:attribute>
    <xs:attribute name="size" type="xs:float" use="required"></xs:attribute>
    <xs:attribute name="bold" type="xs:boolean"></xs:attribute>
    <xs:attribute name="underline" type="xs:boolean"></xs:attribute>
    <xs:attribute name="italic" type="xs:boolean"></xs:attribute>
  </xs:complexType>

  <xs:complexType name="borderStyle">
    <xs:complexContent>
      <xs:extension base="lineStyle">
        <xs:attribute name="radius" type="xs:float"></xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="lineStyle">
    <xs:attribute name="width" type="xs:float"></xs:attribute>
    <xs:attribute name="color" type="color"></xs:attribute>
    <xs:attribute name="dash">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="Solid"></xs:enumeration>
          <xs:enumeration value="Dash"></xs:enumeration>
          <xs:enumeration value="Dot"></xs:enumeration>
          <xs:enumeration value="DashDot"></xs:enumeration>
          <xs:enumeration value="DashDotDot"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="backgroundStyle">
    <xs:attribute name="fillColor" type="color"></xs:attribute>
    <xs:attribute name="alternativeColor" type="color"></xs:attribute>
    <xs:attribute name="hatch" type="hatchStyle"></xs:attribute>
    <xs:attribute name="fillStyle">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="None"></xs:enumeration>
          <xs:enumeration value="Solid"></xs:enumeration>
          <xs:enumeration value="Hatch"></xs:enumeration>
          <xs:enumeration value="Image"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>

  <xs:simpleType name="namedColors">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Black"></xs:enumeration>
      <xs:enumeration value="Red"></xs:enumeration>
      <xs:enumeration value="Blue"></xs:enumeration>
      <xs:enumeration value="Green"></xs:enumeration>
      <xs:enumeration value="Yellow"></xs:enumeration>
      <xs:enumeration value="White"></xs:enumeration>
      <xs:enumeration value="Gray"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="htmlColor">
    <xs:restriction base="xs:string">
      <xs:pattern value="#[0-9a-fA-F]{6}"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="color">
    <xs:union memberTypes="namedColors htmlColor"></xs:union>
  </xs:simpleType>

  <xs:simpleType name="hatchStyle">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Horizontal"/>
      <xs:enumeration value="Vertical"/>
      <xs:enumeration value="ForwardDiagonal"/>
      <xs:enumeration value="BackwardDiagonal"/>
      <xs:enumeration value="Cross"/>
      <xs:enumeration value="DiagonalCross"/>
      <xs:enumeration value="Percent05"/>
      <xs:enumeration value="Percent10"/>
      <xs:enumeration value="Percent20"/>
      <xs:enumeration value="Percent25"/>
      <xs:enumeration value="Percent30"/>
      <xs:enumeration value="Percent40"/>
      <xs:enumeration value="Percent50"/>
      <xs:enumeration value="Percent60"/>
      <xs:enumeration value="Percent70"/>
      <xs:enumeration value="Percent75"/>
      <xs:enumeration value="Percent80"/>
      <xs:enumeration value="Percent90"/>
      <xs:enumeration value="LightDownwardDiagonal"/>
      <xs:enumeration value="LightUpwardDiagonal"/>
      <xs:enumeration value="DarkDownwardDiagonal"/>
      <xs:enumeration value="DarkUpwardDiagonal"/>
      <xs:enumeration value="WideDownwardDiagonal"/>
      <xs:enumeration value="WideUpwardDiagonal"/>
      <xs:enumeration value="LightVertical"/>
      <xs:enumeration value="LightHorizontal"/>
      <xs:enumeration value="NarrowVertical"/>
      <xs:enumeration value="NarrowHorizontal"/>
      <xs:enumeration value="DarkVertical"/>
      <xs:enumeration value="DarkHorizontal"/>
      <xs:enumeration value="DashedDownwardDiagonal"/>
      <xs:enumeration value="DashedUpwardDiagonal"/>
      <xs:enumeration value="DashedHorizontal"/>
      <xs:enumeration value="DashedVertical"/>
      <xs:enumeration value="SmallConfetti"/>
      <xs:enumeration value="LargeConfetti"/>
      <xs:enumeration value="ZigZag"/>
      <xs:enumeration value="Wave"/>
      <xs:enumeration value="DiagonalBrick"/>
      <xs:enumeration value="HorizontalBrick"/>
      <xs:enumeration value="Weave"/>
      <xs:enumeration value="Plaid"/>
      <xs:enumeration value="Divot"/>
      <xs:enumeration value="DottedGrid"/>
      <xs:enumeration value="DottedDiamond"/>
      <xs:enumeration value="Shingle"/>
      <xs:enumeration value="Trellis"/>
      <xs:enumeration value="Sphere"/>
      <xs:enumeration value="SmallGrid"/>
      <xs:enumeration value="SmallCheckerBoard"/>
      <xs:enumeration value="LargeCheckerBoard"/>
      <xs:enumeration value="OutlinedDiamond"/>
      <xs:enumeration value="SolidDiamond"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="report" type="report" ></xs:element>

</xs:schema>
